--[[/**
-- *
-- */]]

---@class BuffEffect302102 : BaseBuffEffect
BuffEffect302102 = ClientFight.CreateClass("BuffEffect302102", ClientFight.BaseBuffEffect)
local t = BuffEffect302102

---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local parameters = {...};
    local fightResult =  parameters[3];
    if ( not AttackUtils.isDamage(fightResult.state))then
    return IBuffEffect.FAIL;
    end
    if (not fightResult:isDamage()) then
    return IBuffEffect.FAIL;
    end
    local random = buff.source.fight:random( Global.TEN_THOUSANDTH);
    if (random <= buff.buffBean.f_BuffEffectValue[1]) then
    fightResult.damage = 0;
    fightResult.setState(DamageResultTypeEnum.IMMUNITY);
        SkillRoleMgr.savePathFile("[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff" .. buff.modelId .. " 免疫伤害成功");
         ClientFight.BaseBuffEffect.action(self, fight, buff, ...);
    end
    return IBuffEffect.FAIL;
end

t.New()